// 封装登录验证
import axios from 'axios'
axios.defaults.baseURL = 'http://127.0.0.1:3000'
var sessionLogin = function () {
    return new Promise((resolve, reject) => {
        let sess = sessionStorage.getItem("cookie-session");
        let encodedData = window.decodeURIComponent(window.atob(sess));
        axios.post("/getUser", {
            uname: encodedData
        }).then(res => {
            resolve(res)
        }).catch(err => {
            reject(err)
        })
    })
}
export default sessionLogin